package cn.lcj.basic.listener;

import cn.lcj.sys.service.IPermissionService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * $
 *
 * @return $
 * @date $ $
 * @description $
 */
@WebListener
public class PermissionScanInitListener implements ServletContextListener {
    @Autowired
    private IPermissionService permissionService;
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        //扫描类上的注解name和sn
        //扫描每个接口类1.类上的requestMapping2.每个方法上的***Mapping。
       // System.out.println("上下文对象创建成功");
        new Thread(new Runnable() {
            @Override
            public void run() {
                permissionService.scanPermission();
            }
        }).start();
    }
}
